#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QPainter>
#include <QPoint>
#include <QMouseEvent>
#include <QProcess>
#include <QTimer>
#include <QRegularExpression>
#include <QRegularExpressionMatchIterator>
#include <QStringList>
#include <QIcon>
#include <QPixmap>
#include <QSystemTrayIcon>
#include <QMenu>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    void mousePressEvent(QMouseEvent*);
    void mouseMoveEvent(QMouseEvent*);
    void mouseReleaseEvent(QMouseEvent*);
    void paintEvent(QPaintEvent*);
    QString GetSizeInfo(qint64);
    void GetNetInformation();
    void GetFreeMemoryInfo();
    void setSystemTray();
    ~MainWindow();
private slots:
    void GetInformation();
    void OnTrayContextMenuClick(QAction*);
private:
    Ui::MainWindow *ui;

    QPoint oldMousePos;
    bool isMousePressed = false;

    QProcess *process;
    QTimer *timer;

    qint64 uploadCount = 0,
           downloadCount = 0,
           oldUploadCount = 0,
           oldDownloadCount = 0;

    QSystemTrayIcon *trayIcon;
};

#endif // MAINWINDOW_H
